package com.smart_environmental_protection.controller;

import com.smart_environmental_protection.pojo.Content;
import com.smart_environmental_protection.pojo.User;
import com.smart_environmental_protection.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class ContentController {
    @Autowired
private ContentService ContentService;
    @PostMapping("/getcontent")

    public Map<String,Object> getContent(){
        Map map=new HashMap<String,Object>();
        Content content=ContentService.getContent(1);

        if (content!=null){ map.put("success",true);
            map.put("msg","成功");
            map.put("data",content);



        }else {
            map.put("success",false);
            map.put("msg","失败");
        }
        return map;
    }
}
